﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Light.Framework.Model;
using Light.Utility;

namespace Light.Framework.Contract
{
    /// <summary>
    /// 系统参数访问组件
    /// </summary>
    public interface ISysParameterComponent
    {
        /// <summary>
        /// 获取参数
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        SysParameter Get(string key);

        /// <summary>
        /// 获取参数值
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        string GetValue(string key);

        /// <summary>
        /// 获取所有参数
        /// </summary>
        /// <returns></returns>
        IList<SysParameter> Get();

        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        OperateResult Save(string key, string value);


        /// <summary>
        ///保存
        /// </summary>
        /// <param name="models"></param>
        /// <returns></returns>
        OperateResult Save(params SysParameter[] models);

        /// <summary>
        /// 删除配置项
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        OperateResult Delete(string key);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        OperateResult Delete(SysParameter model);
    }
}
